package qgs.ddjdispachingsystem.ddj.wcs;


import qgs.ddjdispachingsystem.ddj.ioserver.IOServer;
import qgs.ddjdispachingsystem.ddj.ioserver.IOServerService;

/**
 * @Author: 蔡翔
 * @Date: 2019/11/12 16:27
 * @Version 1.0
 */
public class Test2 {
    public static void main(String args[]) throws InterruptedException {
        Thread a1 = new Thread(()->{
            for (int i=0;i<5;i++){
                final IOServerService instance = IOServer.INSTANCE.getInstance();
                System.out.println("thread1 "+instance.hashCode());
            }
        });
        Thread.sleep(100);

        Thread a2 = new Thread(()->{
            for (int i=0;i<5;i++){
                final IOServerService instance = IOServer.INSTANCE.getInstance();
                System.out.println("thread2 "+instance.hashCode());
            }
        });

        a1.start();
        a2.start();
    }
}
